snippet main1
	#include <bits/stdc++.h>
	#ifdef DEBUG
	#include "/home/lavinraj/career/code-library/debug.cpp"
	#else
	#define dbg(x...) 32
	#endif
	#define len(x) int((x).size())

	using namespace std;

	void print(){cout << "\n";}template<typename T, typename...types> void print(const T& first, const types&...args) {cout << first << " "; print(args...);}

	void solve() {
		$1
	}

	int main() { 
		ios_base::sync_with_stdio(false);
		cin.tie(nullptr);
		int t = 1;
		cin >> t;
		while(t--) {
			solve();
		}
		return 0;
	}

snippet main2
	#include <bits/stdc++.h>
	#ifdef DEBUG
	#include "/home/lavinraj/career/code-library/debug.cpp"
	#else
	#define dbg(x...) 32
	#endif
	#define len(x) int((x).size())

	using namespace std;

	void print(){cout << "\n";}template<typename T, typename...types> void print(const T& first, const types&...args) {cout << first << " "; print(args...);}

	int main() { 
		ios_base::sync_with_stdio(false);
		cin.tie(nullptr);

		$1

		return 0;
	}

snippet generator
	
	#include <bits/stdc++.h>
	using namespace std;

	#define uid(low, high)  uniform_int_distribution<>(low, high)(rng)
	mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

	void print(){cout << "\n";}template<typename T, typename...types> void print(const T& first, const types&...args) {cout << first << " "; print(args...);}

	int main() {
		$1
		return 0;
	}

snippet knapsack
	vector<vector<int>> dp(100, vector<int>(100, -1));

	int knapsack(int index, int remaining_weight, vector<int>& weights, vector<int>& values) {
		/* Base conditions:
		 * 1. When knapsack is full.
		 * 2. When items are finished.
		 */

		if (remaining_weight == 0) return 0;
		if (index < 0) return 0;
		if (dp[index][remaining_weight] != -1) return dp[index][remaining_weight];

		// Not choose
		int ans = knapsack(index - 1, remaining_weight, weights, values);

		// Choose if knapsack has enough space
		if (remaining_weight - weights[index] >= 0)
			ans = max(ans, knapsack(index - 1, remaining_weight - weights[index], weights, values) + values[index]);

		return dp[index][remaining_weight] = ans;
	}

snippet ispalindrome
	template<typename T> bool isPalindrome(T conatiner) {
		int low = 0, high = conatiner.size() - 1;

		while(low < high) {
			if (conatiner[low] != conatiner[high]) return false;
			low++, high--;
		}

		return true;
	}

snippet fenwick_tree
	struct FenwickTree {
			vector<int> bit;
			int n;

			FenwickTree(int n) {
					this->n = n;
					bit.assign(n, 0);
			}

			FenwickTree(vector<int> const &a) : FenwickTree(a.size()) {
					for (size_t i = 0; i < a.size(); i++)
							add(i, a[i]);
			}

			int sum(int r) {
					int ret = 0;
					for (; r >= 0; r = (r & (r + 1)) - 1)
							ret += bit[r];
					return ret;
			}

			int sum(int l, int r) {
					return sum(r) - sum(l - 1);
			}

			void add(int idx, int delta) {
					for (; idx < n; idx = idx | (idx + 1))
							bit[idx] += delta;
			}
	};

snippet sieve
	struct sieve {
		vector<bool> prime;
		sieve(size_t N = 100) {
			prime.assign(N + 1, true);

			prime[0] = prime[1] = false;
			for (int i = 2; i <= N; i++) {
				for (int j = 2; i * j <= N; j++) {
					prime[i * j] = false;
				}
			}
		}

		vector<int> primes() {
			vector<int> result;
			for (int i = 2; i <= int(prime.size()); i++) {
				if (prime[i]) result.push_back(i);
			}

			return result;
		}

		bool isprime(int n) {
			return prime[n];
		}

	} primes($1);

snippet binary_exponentiation
	const int MOD = INT_MAX;
	// TODO: update the MOD value.
	int binary_exponentiation(int A, int B) {
		A %= MOD;
		int result = 1;
		while (B > 0) {
			if (B & 1)
				result = result * 1LL * A % MOD;
			A = A * 1LL * A % MOD;
			B >>= 1;
		}
		return result;
	}

snippet direction
	const vector<pair<int, int>> d4 = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
	const vector<pair<int, int>> d8 = {{1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}, {-1, -1}, {0, -1}, {1, -1}};

snippet sortall
  sort($1.begin(), $1.end());

snippet ceildiv
  template<typename T> T ceil(T n, T k) {
    return n % k == 0 ? n / k : n / k + 1;
  }

snippet floordiv
  template<typename T> T floor(T n, T k) {
    return n % k == 0 ? n / k : n / k - 1;
  }

snippet outputvector
	for (int i = 0; i < ${1:N}; i++)
		cout << ${2:container}[i] << " ";

snippet beginend
	$1.begin(), $1.end()
